function selectElementRange(copyElementSelect) {
  var range = document.createRange()
  range.selectNode(copyElementSelect)
  window.getSelection().removeAllRanges()
  window.getSelection().addRange(range)

  document.execCommand("copy")

  if (copyElementSelect.classList.contains("lsg-remove")) {
    document.body.removeChild(copyElementSelect)
  }

  window.getSelection().removeAllRanges()
}

function testCopy() {
  try {
    document.execCommand("copy")
    return true
  }
  catch (error) {
    return false
  }
}
